/*
 * WireSelection.java
 * 
 * last update: 16.01.2010 by Stefan Saru
 * 
 * author:	Alec(panovici@elcom.pub.ro)
 * 
 * Obs:
 */

package engine;

/**
 * Expressions that can be selections of driven nets should
 * extend this.
 */

abstract class WireSelection
extends Expression implements LeftValue
{

	WireSelection(NameSpace ns) {
		super(ns);
	}

	/**
	 * Returns the strength  and the value
	 * for the specified
	 * bit of the net, packed as an int (bit << 16 | strength).
	 */
	abstract int getStrength (int bitIndex);

	/**
	 * Copies the strengths into the given vector,
	 * starting from the given index.
	 * Tha last one should be large enough to keep 'em.
	 * Mainly used by MContAssignmonitor for port connections.
	 */
	abstract void getStrengths (byte strengths[], int startIndex);

	/**
	 * Copies the new assignement strengths, from
	 * starting from strengths[startIndex].
	 * Mainly used by MContAssignMonitor for port connections.
	 */
	abstract void setStrengths (byte strengths[], int startIndex)
	throws InterpretTimeException;

	/**
	 * Detach this assignement from its taregt wire,
	 * so subsequent calls to its compute methid will not
	 */
	abstract void release();

	/**
	 * Re-attaches thie expression to its target wire
	 */
	abstract void reatach();

	/**
	 * Breaks this wire selection into one-bit
	 * long ContBitSelects.
	 */
	abstract void breakSelection(WireSelection bits[], int startIndex);
}




